package com.fengmi.portal.controller;

import com.fengmi.cms.Content;
import com.fengmi.goods.vo.MallGoodsAndCatVO;
import com.fengmi.goods.vo.MallGoodsCatVO;
import com.fengmi.portal.service.PortalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController      //返回的是数据 @ResponseBody+ @Controller
@RequestMapping("portal")
public class PortalController {
    @Autowired
    PortalService portalService;

    @RequestMapping("getAllContentsList/{categoryId}")
    public List<Content> getAllContentsList(@PathVariable("categoryId") Long categoryId) {
        return    portalService.getAllContentsList(categoryId);
    }
    @RequestMapping("getAllGoodsCat")
    public List<MallGoodsCatVO> getAllGoodsCat() {
        return   portalService.getAllGoodsCat();
    }

    @RequestMapping("getAllGoodsAndCat")
    public List<MallGoodsAndCatVO> getAllGoodsAndCat(){
       return  portalService.getAllGoodsAndCat();
    }



}
